package com.hm.shopping.def;

/**
 * @author shishun.wang
 * @date 2018年1月22日 下午2:47:05
 * @version 1.0
 * @describe 订单状态
 */
public enum OrderStateEnum {

	/**
	 * 待支付
	 */
	STAY_PAYMENT("STAY_PAYMENT", "待支付"),

	/**
	 * 完成支付
	 */
	FINISH_PAYMENT("FINISH_PAYMENT", "完成支付"),

	/**
	 * 已发货
	 */
	FINISH_COURIER("FINISH_COURIER", "已发货"),

	/**
	 * 已完成
	 */
	FINISH("FINISH", "已完成"),

	/**
	 * 退换
	 */
	REFUND("REFUND", "退换");

	private String status;

	private String desc;

	private OrderStateEnum(String status, String desc) {
		this.status = status;
		this.desc = desc;
	}

	public String desc() {
		return this.desc;
	}

	public String status() {
		return this.status;
	}

	public static OrderStateEnum trance(String status) {
		for (OrderStateEnum statusDef : OrderStateEnum.values()) {
			if (statusDef.name().equals(status)) {
				return statusDef;
			}
		}
		return null;
	};
}
